<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>弹性盒子</title>
    <style>
        .box{
            width: 500px;
            height: 500px;
            border: 1px solid black;
            margin: 0 auto;
            /*
            1. 子元素默认横线排列
            2. 子元素不管是不是块元素，都会按照块元素展示(能设置宽高)*/
            display: flex;
        }
        .box div{
            width: 100px;
            height: 100px;
            border: 1px dashed red;
        }

        .box1{
            width: 500px;
            height: 500px;
            border: 1px solid black;
            margin: 50px auto;
            display: flex;
        }
        .box1 div{
            width: 100px;
            height: 100px;
            border: 1px dashed red;
            /*flex布局下 子元素使用该属性，会水平垂直居中 多个元素是水平并排*/
            margin: auto;
        }
    </style>
</head>
<body>
    <div class="box">
        <div>11111111</div>
        <div>22222222</div>
        <div>33333334</div>
        <div>44444444</div>
        <div>55555555</div>
        <div>66666666</div>
        <div>77777777</div>
    </div>

    <div class="box1">
        <div>11111111</div>
        <div>11111111</div>
        <div>11111111</div>
    </div>
</body>
</html>